Skip to content

fix: enhance get_user_if_exists pipeline function with debugging capabilities#390

Closed
Akanshu-2u wants to merge 21 commits intoopenedx:masterfrom
Akanshu-2u:akanshu/bug-in-third-party-authentication-email-and-name-update
Closed

fix: enhance get_user_if_exists pipeline function with debugging capabilities#390
Akanshu-2u wants to merge 21 commits intoopenedx:masterfrom
Akanshu-2u:akanshu/bug-in-third-party-authentication-email-and-name-update

Conversation

@Akanshu-2u
Copy link
Copy Markdown
Contributor

@Akanshu-2u Akanshu-2u commented Jul 24, 2025

Description:

The get_user_if_exists function lacks visibility into authentication failures. We can't debug why "user already exists" errors happen in devstack but not in stage.

Solution:

  • Added comprehensive debugging with new toggle IGNORE_LOGGED_IN_USER_ON_MISMATCH.

  • Added custom attributes to track authentication flow and detect issues:

        - Username mismatches between details and existing users.
        - User lookup success/failure states.
        - Database errors during user retrieval.
    
  • Improved logging with detailed info and warning messages.

  • Removed unnecessary pass statement for cleaner code.

JIRA Ticket:

BOMS-3

Reference PR:

PR

Reference pr for testing legacy get_user_if_exists code with current test_file:

#395

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants